/*
 * 版权所有(c)  1952110078@qq.com  2022 - 2022
 */

package com.ldc.commonlibs.utils;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * @author liudc
 * @since 2022/7/21 23:58
 */
public class NumberUtil {
    private static final int MYRIAD = 10000;

    public static String int2String(float count) {
        if (count <= 0) {
            return "";
        } else if (count < 100) {
            return count + "";
        } else {
            double result = (count / MYRIAD);
            BigDecimal bigDecimal = new BigDecimal(result);
            result = bigDecimal.setScale(1, RoundingMode.HALF_UP).doubleValue();
            return result + "万";
        }
    }
}
